package com.ash;

import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;

import java.io.IOException;

public class Main {


    public static void main(String[] args) throws IOException {
        ReferenceConfig<IHelloService> ref=new ReferenceConfig<>();
        ref.setInterface(IHelloService.class);


        DubboBootstrap.getInstance()
                .application("consumer")
//                .protocol(new ProtocolConfig("tri",-1))
                .registry(new RegistryConfig("nacos://127.0.0.1:8848"))
                .reference(ref);

        IHelloService iHelloService = ref.get();

        System.out.println(iHelloService.say("zjh"));

        System.in.read();

    }
}
